<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class InitJikaRecord extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('jika_swap_records', function (Blueprint $table) {
            $table->comment = '集卡';

            $table->increments('id');
            $table->uuid('uuid')->index() ;

            $table->integer('activity_id')->index()->comment('活动id');
            $table->integer('task_id')->index()->comment('任务id');
            $table->integer('sku_id')->index()->comment('奖品id');
            $table->integer('user_id')->index()->comment('用户id');

            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::disableForeignKeyConstraints();
        Schema::dropIfExists('jika_swap_records');
    }
}
